﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EasyPiano
{
    public partial class SetViewForm : Form
    {
        public SetViewForm()
        {
            InitializeComponent();
            nud_image_count.Value = GlobalData.imageCount;
            cb_show_view.SelectedIndex = GlobalData.showView;            
            cb_keyboard_view.SelectedIndex = GlobalData.keyboardView;
            cb_piano_view.SelectedIndex = GlobalData.pianoKeyboardView;
        }

        private void bt_ok_Click(object sender, EventArgs e)
        {
            GlobalData.imageCount = (int)(nud_image_count.Value);
            GlobalData.showView = cb_show_view.SelectedIndex;
            GlobalData.keyboardView = cb_keyboard_view.SelectedIndex;
            GlobalData.pianoKeyboardView = cb_piano_view.SelectedIndex;
            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
